/*
 * @Author: szx
 * @Date: 2022-02-28 16:11:40
 * @LastEditTime: 2022-02-28 16:11:40
 * @Description: 
 * @FilePath: \leetcode\1000-1099\1047\1047_2.js
 */
var removeDuplicates = function (s) {
    const st = [];
    for (let ch of s) {
        if (st.length != 0 && st[st.length - 1] == ch) {
            st.pop();
        } else {
            st.push(ch);
        }
    }
    return st.join('');
};
